<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<html>
<head>
	<title>工程单据管理</title>
	<meta name="decorator" content="default"/>
	<%
		Object optObj = request.getAttribute("opt");
		String opt = null;
		if(optObj!=null){
			opt = (String)optObj;
		}
		if(opt!=null && opt.equals("detail")){ 
	%>
	 <script type="text/javascript">
		$(document).ready(function() {
			$(this).find("input").each(function() {
				$(this).attr("disabled", "disabled");
				}); 
			$(this).find("select").each(function() {
				$(this).attr("disabled", "disabled");
				});
		});
		alert($("#contentCrontrol").innerHtml)
		function escape2Html(str) {
		 var arrEntities={'lt':'<','gt':'>','nbsp':' ','amp':'&','quot':'"'};
		 return str.replace(/&(lt|gt|nbsp|amp|quot);/ig,function(all,t){return arrEntities[t];});
		}
		$("#contentCrontrol").innerHTML = '${bizProjectBill.explainContent}'
	</script>
	 <%
	 	}else{
	 %>
	<script type="text/javascript">
		$(document).ready(function() {
			//$("#name").focus();
			$("#inputForm").validate({
				submitHandler: function(form){
					loading('正在提交，请稍等...');
					form.submit();
				},
				errorContainer: "#messageBox",
				errorPlacement: function(error, element) {
					$("#messageBox").text("输入有误，请先更正。");
					if (element.is(":checkbox")||element.is(":radio")||element.parent().is(".input-append")){
						error.appendTo(element.parent().parent());
					} else {
						error.insertAfter(element);
					}
				}
			});
		});
	</script>
	<%}%>
</head>
<body>
	<ul class="nav nav-tabs">
		<li class="active">工程单据</li>
	</ul><br/>
	<form:form id="inputForm" modelAttribute="bizProjectBill" action="${ctx}/bill/bizProjectBill/save" method="post" class="form-horizontal">
		<form:hidden path="id"/>
		<sys:message content="${message}"/>		
		<div class="control-group">
			<label class="control-label">工程中心编码：</label>
			<div class="controls">
				<form:input path="id" htmlEscape="false" maxlength="255" class="input-xlarge required"/>
				<span class="help-inline"></span>
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">工程中心名称：</label>
			<div class="controls">
				<form:input path="proName" htmlEscape="false" maxlength="255" class="input-xlarge required"/>
				<span class="help-inline"></span>
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">运行模式：</label>
			<div class="controls">
				<form:select path="proType" class="input-xlarge ">
					<form:option value="" label=""/>
					<form:options items="${fns:getDictList('proType')}" itemLabel="label" itemValue="value" htmlEscape="false"/>
				</form:select>
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">申请类型：</label>
			<div class="controls">
				<form:select path="billType" class="input-xlarge ">
					<form:option value="" label=""/>
					<form:options items="${fns:getDictList('billType')}" itemLabel="label" itemValue="value" htmlEscape="false"/>
				</form:select>
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">所属地区：</label>
			<div class="controls">
				<form:select path="provinceId" class="input-xlarge ">
					<form:option value="" label=""/>
					<form:options items="${fns:getProvinceList()}" itemLabel="provinceName" itemValue="id" htmlEscape="false"/>
				</form:select>
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">行业领域：</label>
			<div class="controls">
				<form:select path="categoryId" class="input-xlarge ">
					<form:option value="" label=""/>
					<form:options items="${fns:getDictList('category_id')}" itemLabel="label" itemValue="value" htmlEscape="false"/>
				</form:select>
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">细分行业领域：</label>
			<div class="controls">
				<form:select path="subCategoryId" class="input-xlarge ">
					<form:option value="" label=""/>
					<form:options items="${fns:getDictList('sub_category_id')}" itemLabel="label" itemValue="value" htmlEscape="false"/>
				</form:select>
			</div>
		</div>
		
		<div class="control-group">
			<label class="control-label">拟开工时间：</label>
			<div class="controls">
				<input name="proStartTime" type="text" readonly="readonly" maxlength="20" class="input-medium Wdate "
					value="<fmt:formatDate value="${bizProjectBill.proStartTime}" pattern="yyyy-MM-dd HH:mm:ss"/>"
					onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',isShowClear:false});"/>
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">拟建成时间：</label>
			<div class="controls">
				<input name="proEndTime" type="text" readonly="readonly" maxlength="20" class="input-medium Wdate "
					value="<fmt:formatDate value="${bizProjectBill.proEndTime}" pattern="yyyy-MM-dd HH:mm:ss"/>"
					onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',isShowClear:false});"/>
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">审核内容：</label>
			<div class="controls" id="contentCrontrol" RUNAT=SERVER>
				<% 
				if(opt!=null && opt.equals("detail")){ 
						%>
						${bizProjectBill.explainContent}
						<%
					}else{
						%>
						<form:textarea id="explainContent" htmlEscape="true" path="explainContent" rows="4" maxlength="200" class="input-xxlarge"/>
						<sys:ckeditor replace="explainContent" uploadPath="/cms/article" />
						<%
					}
				%>
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">主管单位负责人：</label>
			<div class="controls">
				<form:select path="responserId" class="input-xlarge ">
					<form:option value="" label=""/>
					<form:options items="${fns:getDictList('')}" itemLabel="label" itemValue="value" htmlEscape="false"/>
				</form:select>
			</div>
		</div>
		
		<div class="control-group">
			<label class="control-label">联系电话：</label>
			<div class="controls">
				<form:input path="responserTelNo" htmlEscape="false" maxlength="64" class="input-xlarge "/>
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">工程中心负责人：</label>
			<div class="controls">
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">审批状态：</label>
			<div class="controls">
				<form:input path="billStatusName" htmlEscape="false" maxlength="255" class="input-xlarge "/>
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">批复单位：</label>
			<div class="controls">
				<form:input path="applyCompany" htmlEscape="false" maxlength="64" class="input-xlarge "/>
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">批复日期：</label>
			<div class="controls">
				<input name="applyDate" type="text" readonly="readonly" maxlength="20" class="input-medium Wdate "
					value="<fmt:formatDate value="${bizProjectBill.applyDate}" pattern="yyyy-MM-dd HH:mm:ss"/>"
					onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',isShowClear:false});"/>
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">批复文号：</label>
			<div class="controls">
				<form:input path="applyFileNo" htmlEscape="false" maxlength="64" class="input-xlarge "/>
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">联系电话：</label>
			<div class="controls">
				<form:input path="responserTelNo" htmlEscape="false" maxlength="64" class="input-xlarge "/>
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">工程中心负责人：</label>
			<div class="controls">
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">联系电话：</label>
			<div class="controls">
				<form:input path="centerTelNo" htmlEscape="false" maxlength="64" class="input-xlarge "/>
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">负责人名称：</label>
			<div class="controls">
				<form:input path="responserName" htmlEscape="false" maxlength="255" class="input-xlarge "/>
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">工程中心联系人：</label>
			<div class="controls">
				<form:input path="centerResponserName" htmlEscape="false" maxlength="64" class="input-xlarge "/>
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">联系电话：</label>
			<div class="controls">
				<form:input path="linkTelNo" htmlEscape="false" maxlength="64" class="input-xlarge "/>
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">电子邮箱：</label>
			<div class="controls">
				<form:input path="linkMobile" htmlEscape="false" maxlength="64" class="input-xlarge "/>
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">传真：</label>
			<div class="controls">
				<form:input path="faxCode" htmlEscape="false" maxlength="64" class="input-xlarge "/>
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">工程中心网址：</label>
			<div class="controls">
				<form:input path="centerSiteUrl" htmlEscape="false" maxlength="64" class="input-xlarge "/>
			</div>
		</div>
		<div class="form-actions">
			<shiro:hasPermission name="bill:bizProjectBill:edit"><input id="btnSubmit" class="btn btn-primary" type="submit" value="保 存"/>&nbsp;</shiro:hasPermission>
			<input id="btnCancel" class="btn" type="button" value="返 回" onclick="history.go(-1)"/>
		</div>
	</form:form>
</body>
</html>